package com.oocl.analyser.impl;

import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.oocl.analyser.Analyser;
import com.oocl.pojo.Customer;

/**
 * 实现类
 * @author GANAB
 *
 */
public class AnalyserImpl implements Analyser {
	private List<Customer> customers = null;
	
	public AnalyserImpl(List<Customer> customers){
		this.customers=customers;
	}
	
	public Set<Customer> analyse(Comparator<Customer> comp) {
		if(customers==null)
			return null;
		
		Set<Customer> set=new TreeSet<Customer>(comp);
		for(Customer c:customers){
			set.add(c);
		}
		
		return set;
	}


}
